package com.example;

import com.example.framework.ReflectionFramework;
import com.example.entity.Student;
import com.example.entity.Teacher;

public class App {
    public static void main(String[] args) {
        try {
            ReflectionFramework framework = new ReflectionFramework();

            System.out.println("=== Creating objects and invoking methods ===");

            Object student = framework.createObject("student.class");
            System.out.println("Created student: " + student);

            framework.invokeMethod(student, "student.introduce");
            framework.invokeMethod(student, "student.study");
            Object gradeResult = framework.invokeMethod(student, "student.getGrade");
            System.out.println("Grade result: " + gradeResult);

            System.out.println("\n" + "=".repeat(50) + "\n");


            Object teacher = framework.createObject("teacher.class.param");
            System.out.println("Created teacher: " + teacher);

            framework.invokeMethod(teacher, "teacher.teach");
            Object evaluation = framework.invokeMethod(teacher, "teacher.evaluate");
            System.out.println("Evaluation: " + evaluation);

            System.out.println("\n" + "=".repeat(50) + "\n");


            System.out.println("Calling static method:");
            framework.invokeStaticMethod("static.method");

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}